<template>
  <div class="loading" :class="size">
    <div></div>
    <div></div>
    <div></div>
    <div></div>
  </div>
</template>

<script>
export default {
  props: {
    size: {
      type: String,
      default: 'large'
    }
  }
}
</script>

<style lang="less" scoped>
.large {
  width: 64px;
  height: 64px;

  div {
    width: 52px;
    height: 52px;
  }
}

.loading.small {
  width: 32px;
  height: 32px;

  div {
    width: 20px;
    height: 20px;
    border-width: 4px;
  }
}

.loading.middle {
  width: 42px;
  height: 42px;

  div {
    width: 30px;
    height: 30px;
    border-width: 3px;
    border-top-color: #008296;
  }
}

.loading {
  position: relative;

  div {
    position: absolute;
    margin: 6px;
    border: 6px solid transparent;
    border-top-color: #002f36;
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(.5,0,.5,1) infinite;

    &:first-of-type {
      animation-delay: -.45s;
    }
    &:nth-of-type(2) {
      animation-delay: -.3s;
    }
    &:nth-of-type(3) {
      animation-delay: -.15s;
    }
  }
  @keyframes spin {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(1turn);
    }
  }
}
</style>
